package sharemem

import (
	"encoding/json"
	"server_cluster/common/config"
	"server_cluster/common/gdconf"
	"server_cluster/common/logger"
	"server_cluster/common/protoc/pb"
	"slices"
)

// 任务接取条件
const (
	QUEST_ACCEPT_COND_TYPE_FINISH_PARENT_QUEST = 1 // 完成父任务 参数1:父任务id
	QUEST_ACCEPT_COND_TYPE_PLAYER_LEVEL        = 2 // 玩家等级 参数1:玩家等级
	QUEST_ACCEPT_COND_TYPE_FINISH_QUEST        = 4 // 完成任务 参数1:任务id
)

const (
	RefreshDailyQuestHourOffset = 0
	RefreshDailyQuestMaxNum     = 1
)

// 任务完成条件
const (
	QUEST_FINISH_COND_TYPE_FINISH_TALK                  = 1  // 完成任意对话 参数1:对话id
	QUEST_FINISH_COND_TYPE_FINISH_PLOT                  = 2  // 完成剧情 参数1:剧情id
	QUEST_FINISH_COND_TYPE_ENTER_SCENE                  = 3  // 进入场景 参数1:场景id
	QUEST_FINISH_COND_TYPE_FINISH_FIGHT                 = 4  // 完成战斗 参数1:战斗id
	QUEST_FINISH_COND_TYPE_SCENE_INTERACT               = 5  // 场景物件交互 参数1:场景id 参数2:交互物件id
	QUEST_FINISH_COND_TYPE_FINISH_PARENT_QUEST          = 6  // 完成父任务 参数1:父任务id
	QUEST_FINISH_COND_TYPE_HAVE_ITEM                    = 7  // 拥有道具 参数1:道具id 参数2:道具数量
	QUEST_FINISH_COND_TYPE_GIVE_ITEM                    = 8  // 上交道具 参数1:道具id 参数2:道具数量
	QUEST_FINISH_COND_TYPE_PLAYER_LEVEL                 = 9  // 玩家等级 参数1:玩家等级
	QUEST_FINISH_COND_TYPE_FINISH_BATTLEGROUP           = 10 // 完成指定战斗 参数:战斗
	QUEST_FINISH_COND_TYPE_SCENE_TRIGGER                = 11 // 场景触发器 参数1:场景id 参数2:触发器交互物件id
	QUEST_FINISH_COND_TYPE_TEAM_ROLE_NUM                = 12 // 队伍上阵角色 参数1:角色数量
	QUEST_FINISH_COND_TYPE_ROLE_UPGRADE                 = 13 // 角色升级 参数1:等级 参数2:角色数量
	QUEST_FINISH_COND_TYPE_ROLE_PROMOTE                 = 14 // 角色升阶 参数1:等阶 参数2:角色数量
	QUEST_FINISH_COND_TYPE_ROLE_STAR                    = 15 // 角色升星 参数1:星级 参数2:角色数量
	QUEST_FINISH_COND_TYPE_BUILD_EQUIP                  = 16 // 打造装备 参数1:装备数量
	QUEST_FINISH_COND_TYPE_HOME_SEED                    = 17 // 家园播种 参数1:播种数量
	QUEST_FINISH_COND_TYPE_HOME_GATHER                  = 18 // 家园收获 参数1:收获数量
	QUEST_FINISH_COND_TYPE_EQUIP_WEAR                   = 19 // 装备穿戴 参数1:装备数量
	QUEST_FINISH_COND_TYPE_EQUIP_UPGRADE                = 20 // 装备升级 参数1:等级 参数2:装备数量
	QUEST_FINISH_COND_TYPE_EQUIP_JEWEL_WEAR             = 21 // 装备宝石镶嵌 参数1:宝石数量 参数2:装备数量
	QUEST_FINISH_COND_TYPE_HAVE_HOME_BUILDING_FOR_LEVEL = 22 // 家园建筑等级数量 参数1:等级 参数2:数量 参数3:建筑id
	QUEST_FINISH_COND_TYPE_ROLE_COUNT                   = 23 // 获取角色数量 参数1:数量
	QUEST_FINISH_COND_TYPE_WEAR_WEAPON                  = 24 // 穿戴武器数量 参数1:数量
	QUEST_FINISH_COND_TYPE_ACTIVITY_DUNGEON             = 25 // 完成指定活动下的副本 参数1:活动id 参数2:副本id
	QUEST_FINISH_COND_TYPE_ACTIVITY_DUNGEON_COUNT       = 26 // 完成指定活动下的副本 参数1:活动id 参数2:次数
	QUEST_FINISH_COND_TYPE_GACHA_COUNT                  = 27 // 完成抽卡次数 参数1:次数
	QUEST_FINISH_COND_TYPE_ROLE_WEAR_EQUIP_COUNT        = 28 // 指定角色穿戴装备数量 参数1：角色id 参数2：数量
	QUEST_FINISH_COND_TYPE_BUILD_EQUIP_FOR_GROUP        = 29 // 打造套装组id下的X件装备 参数1:套装组id，参数2:打造数量
	QUEST_FINISH_COND_TYPE_ROLE_LEVEL                   = 30 // 指定角色到达x等级 参数1：角色id 参数2：角色等级
	QUEST_FINISH_COND_TYPE_AWARD_ITEM_BY_BUILDING       = 31 // 从家园收获指定道具 参数1：道具id 参数2：数量
	QUEST_FINISH_COND_TYPE_GADGET_STATE                 = 32 // 交互件为指定状态 参数1：场景id 参数2：交互件id 参数3：状态
	QUEST_FINISH_COND_TYPE_WEAPON_COUNT_BY_LEVEL        = 33 // 拥有N件强化到M级的武器 参数1：强化等级 参数2：数量
	QUEST_FINISH_COND_TYPE_EQUIP_COUNT_BY_LEVEL         = 34 // 拥有N件强化到M级的装备 参数1：强化等级 参数2：数量
)

// 事件执行类型
const (
	EVENT_EXEC_TYPE_UNLOCK_SCENE              = 1 // 解锁场景 参数1:场景id
	EVENT_EXEC_TYPE_CHANGE_SCENE_GADGET_STATE = 2 // 解锁场景 参数1:场景id 参数2:交互物件id 参数3:状态
	EVENT_EXEC_TYPE_ENTER_SCENE               = 5 // 进入场景 参数1:场景id 参数2:场景tag
	EVENT_EXEC_TYPE_UNLOCK_DAILY_QUEST        = 6 // 解锁日常任务
	EVENT_EXEC_TYPE_REWARD                    = 7 // 发放奖励 参数1:奖励id
)

// QuestCond 任务完成条件
type QuestCond struct {
	Type         int32    // 完成条件类型
	ParamList    [5]int32 // 完成条件参数列表
	ParamListLen int32    // 完成条件参数列表长度
}

func (q *QuestCond) GetCondParamList() []int32 {
	ret := make([]int32, 0, q.ParamListLen)
	for i := int32(0); i < q.ParamListLen; i++ {
		ret = append(ret, q.ParamList[i])
	}
	return ret
}

func (q *QuestCond) MemInit() {
	q.Type = 0
	for i := 0; i < len(q.ParamList); i++ {
		q.ParamList[i] = 0
	}
	q.ParamListLen = 0
}

// Quest 子任务
type Quest struct {
	QuestId  int32        // 子任务id
	State    int32        // 子任务完成状态
	CondList [5]QuestCond // 子任务完成条件列表

	//在线数据
	ParentQuestId int32 `json:"-"`
	NextQuestId   int32 `json:"-"`
}

func (q *Quest) MemInit() {
	q.QuestId = 0
	q.State = 0
	for i := 0; i < len(q.CondList); i++ {
		q.CondList[i].MemInit()
	}
	q.NextQuestId = 0
	q.ParentQuestId = 0
}

func (q *Quest) GetCondList() []*QuestCond {
	ret := make([]*QuestCond, 0, len(q.CondList))
	for i := 0; i < len(q.CondList); i++ {
		cond := &(q.CondList[i])
		if cond.Type == 0 {
			break
		}
		ret = append(ret, cond)
	}
	return ret
}

// ParentQuest 父任务
type ParentQuest struct {
	ParentQuestId int32     // 父任务id
	State         int32     // 父任务完成状态
	QuestList     [20]Quest // 子任务列表
	CurrQuestId   int32     // 当前的子任务id
	Type          int32     // 主线任务类型
}

func (p *ParentQuest) IsUse() bool {
	return p.ParentQuestId != 0
}

func (p *ParentQuest) MemInit() {
	p.ParentQuestId = 0
	p.State = 0
	for i := 0; i < len(p.QuestList); i++ {
		p.QuestList[i].MemInit()
	}
	p.CurrQuestId = 0
}

func (p *ParentQuest) GetQuestList() []*Quest {
	ret := make([]*Quest, 0, len(p.QuestList))
	for i := 0; i < len(p.QuestList); i++ {
		quest := &(p.QuestList[i])
		if quest.QuestId == 0 {
			break
		}
		ret = append(ret, quest)
	}
	return ret
}

// ClientEvent 待完成的客户端事件
type ClientEvent struct {
	Type      int32    // 事件类型
	ParamList [5]int32 // 事件参数列表
}

func (c *ClientEvent) MemInit() {
	c.Type = 0
	for i := 0; i < len(c.ParamList); i++ {
		c.ParamList[i] = 0
	}
}

func (c *ClientEvent) GetParamList() []int32 {
	ret := make([]int32, 0, len(c.ParamList))
	for i := 0; i < len(c.ParamList); i++ {
		if c.ParamList[i] == 0 {
			break
		}
		ret = append(ret, c.ParamList[i])
	}
	return ret
}

// UserQuest 任务
type UserQuest struct {
	MainQuestList             [50]ParentQuest // 主线任务列表
	SideQuestList             [50]ParentQuest // 支线任务列表
	DailyQuestList            [10]ParentQuest // 每日任务列表
	LastDailyQuestRefreshTime int64           // 上次每日任务刷新时间戳 秒
	DailyQuestUnlock          bool            // 每日任务解锁标记
	OpenStateIdList           [100]int32      // 已解锁功能开放id
	ParentQuestFinishList     [100]int32

	// 在线数据
	triggerQuestRecDepth int32
	execEventRecDepth    int32
}

func (q *UserQuest) MarshalJSON() ([]byte, error) {
	dbUserQuest := struct {
		MainQuestList             []ParentQuest // 主线任务列表
		SideQuestList             []ParentQuest // 支线任务列表
		DailyQuestList            []ParentQuest // 每日任务列表
		LastDailyQuestRefreshTime int64         // 上次每日任务刷新时间戳 秒
		DailyQuestUnlock          bool          // 每日任务解锁标记
		OpenStateIdList           []int32       // 已解锁功能开放id
		ParentQuestFinishList     []int32       // 已完成父任务id
	}{}
	for _, parentQuest := range q.MainQuestList {
		if !parentQuest.IsUse() {
			continue
		}
		dbUserQuest.MainQuestList = append(dbUserQuest.MainQuestList, parentQuest)
	}
	for _, parentQuest := range q.SideQuestList {
		if !parentQuest.IsUse() {
			continue
		}
		dbUserQuest.SideQuestList = append(dbUserQuest.SideQuestList, parentQuest)
	}
	for _, parentQuest := range q.DailyQuestList {
		if !parentQuest.IsUse() {
			continue
		}
		dbUserQuest.DailyQuestList = append(dbUserQuest.DailyQuestList, parentQuest)
	}
	dbUserQuest.LastDailyQuestRefreshTime = q.LastDailyQuestRefreshTime
	dbUserQuest.DailyQuestUnlock = q.DailyQuestUnlock
	for _, openStateId := range q.OpenStateIdList {
		if openStateId == 0 {
			continue
		}
		dbUserQuest.OpenStateIdList = append(dbUserQuest.OpenStateIdList, openStateId)
	}
	for _, id := range q.ParentQuestFinishList {
		dbUserQuest.ParentQuestFinishList = append(dbUserQuest.ParentQuestFinishList, id)
	}
	data, err := json.Marshal(dbUserQuest)
	if err != nil {
		return nil, err
	}
	return data, nil
}

func (q *UserQuest) UnmarshalJSON(data []byte) error {
	dbUserQuest := struct {
		MainQuestList             []ParentQuest // 主线任务列表
		SideQuestList             []ParentQuest // 支线任务列表
		DailyQuestList            []ParentQuest // 每日任务列表
		LastDailyQuestRefreshTime int64         // 上次每日任务刷新时间戳 秒
		DailyQuestUnlock          bool          // 每日任务解锁标记
		OpenStateIdList           []int32       // 已解锁功能开放id
		ParentQuestFinishList     []int32
	}{}
	err := json.Unmarshal(data, &dbUserQuest)
	if err != nil {
		return err
	}
	for index, parentQuest := range dbUserQuest.MainQuestList {
		q.MainQuestList[index] = parentQuest
	}

	for index, parentQuest := range dbUserQuest.SideQuestList {
		q.SideQuestList[index] = parentQuest
	}

	for index, parentQuest := range dbUserQuest.DailyQuestList {
		q.DailyQuestList[index] = parentQuest
	}

	q.LastDailyQuestRefreshTime = dbUserQuest.LastDailyQuestRefreshTime
	q.DailyQuestUnlock = dbUserQuest.DailyQuestUnlock
	for index, openStateId := range dbUserQuest.OpenStateIdList {
		q.OpenStateIdList[index] = openStateId
	}
	for index, parentQuest := range dbUserQuest.ParentQuestFinishList {
		q.ParentQuestFinishList[index] = parentQuest
	}
	return nil
}

func (q *UserQuest) MemInit() {
	for i := 0; i < len(q.MainQuestList); i++ {
		q.MainQuestList[i].MemInit()
	}
	for i := 0; i < len(q.SideQuestList); i++ {
		q.SideQuestList[i].MemInit()
	}
	for i := 0; i < len(q.DailyQuestList); i++ {
		q.DailyQuestList[i].MemInit()
	}
	q.LastDailyQuestRefreshTime = 0
	q.DailyQuestUnlock = false
	for i := 0; i < len(q.OpenStateIdList); i++ {
		q.OpenStateIdList[i] = 0
	}
	for i := 0; i < len(q.ParentQuestFinishList); i++ {
		q.ParentQuestFinishList[i] = 0
	}

	q.triggerQuestRecDepth = 0
	q.execEventRecDepth = 0
}

func (u *User) CheckParentFinish(questId int32) bool {
	var tmp = u.GetParentQuestFinish()
	return tmp[questId]
}

func (u *User) CheckSubQuestFinish(questId int32) bool {
	var questConfig = gdconf.GetConfigQuest(questId)
	if questConfig == nil {
		return false
	}
	if u.CheckParentFinish(questConfig.ParentQuestId) {
		return true
	}
	var parentQuest = u.GetParentQuest(questConfig.ParentQuestId)
	if parentQuest == nil {
		return false
	}
	var subQuest = u.GetSubQuest(questConfig.ParentQuestId, questId)
	if subQuest == nil {
		return false
	}
	return subQuest.State == config.QUEST_STATE_FIN
}

func (u *User) GetTriggerQuestRecDepth() int32 {
	return u.UserQuest.triggerQuestRecDepth
}
func (u *User) SetTriggerQuestRecDepth(value int32) {
	u.UserQuest.triggerQuestRecDepth = value
}
func (u *User) AddTriggerQuestRecDepth(value int32) {
	u.UserQuest.triggerQuestRecDepth += value
}
func (u *User) SubTriggerQuestRecDepth(value int32) {
	u.UserQuest.triggerQuestRecDepth -= value
	if u.UserQuest.triggerQuestRecDepth < 0 {
		logger.Error("triggerQuestRecDepth is :%v", u.UserQuest.triggerQuestRecDepth)
	}
}

func (u *User) GetExecEventRecDepth() int32 {
	return u.UserQuest.execEventRecDepth
}
func (u *User) SetExecEventRecDepth(value int32) {
	u.UserQuest.execEventRecDepth = value
}
func (u *User) AddExecEventRecDepth(value int32) {
	u.UserQuest.execEventRecDepth += value
}
func (u *User) SubExecEventRecDepth(value int32) {
	u.UserQuest.execEventRecDepth -= value
	if u.UserQuest.execEventRecDepth < 0 {
		logger.Error("execEventRecDepth is :%v", u.UserQuest.execEventRecDepth)
	}
}

func (u *User) GetDailyQuestUnlock() bool {
	return u.UserQuest.DailyQuestUnlock
}

func (u *User) SetDailyQuestUnlock(value bool) {
	u.UserQuest.DailyQuestUnlock = value
}

func (q *UserQuest) GetOpenState() []int32 {
	ret := make([]int32, 0)
	for i := 0; i < len(q.OpenStateIdList); i++ {
		if q.OpenStateIdList[i] == 0 {
			break
		}
		ret = append(ret, q.OpenStateIdList[i])
	}
	return ret
}

func (q *UserQuest) CheckOpenState(openStateId int32) bool {
	return slices.Contains[[]int32, int32](q.GetOpenState(), openStateId)
}

func (q *UserQuest) UnlockOpenState(openStateId int32) {
	for i := 0; i < len(q.OpenStateIdList); i++ {
		if q.OpenStateIdList[i] != 0 {
			continue
		}
		q.OpenStateIdList[i] = openStateId
		return
	}
	logger.Error("no empty open state")
}

func (u *User) OnParentQuestFinish(parentQuestId int32) {
	if u.CheckParentFinish(parentQuestId) {
		return
	}
	for i := 0; i < len(u.UserQuest.ParentQuestFinishList); i++ {
		if u.UserQuest.ParentQuestFinishList[i] == 0 {
			u.UserQuest.ParentQuestFinishList[i] = parentQuestId
			break
		}
	}
	u.AddParentQuestFinish(parentQuestId)
}

func (u *User) PacketQuest(quest *Quest) *pb.Quest {
	questCondList := quest.GetCondList()
	pbCondList := make([]*pb.QuestCond, 0, len(questCondList))
	for _, questCond := range questCondList {
		pbCondList = append(pbCondList, &pb.QuestCond{
			CondType:      questCond.Type,
			CurrCondParam: questCond.GetCondParamList(),
		})
	}
	return &pb.Quest{
		QuestId:  quest.QuestId,
		State:    quest.State,
		CondList: pbCondList,
	}
}

func (u *User) PacketParentQuest(parentQuest *ParentQuest) *pb.ParentQuest {
	var currQuest = u.GetSubQuest(parentQuest.ParentQuestId, parentQuest.CurrQuestId)
	if currQuest == nil {
		logger.Error("get curr quest is nil, currQuestId: %v, uid: %v", parentQuest.CurrQuestId, u.GetUid())
		return nil
	}
	return &pb.ParentQuest{
		ParentQuestId: parentQuest.ParentQuestId,
		State:         parentQuest.State,
		Quest:         u.PacketQuest(currQuest),
	}
}

func (u *User) GetQuest(parentQuestId int32, questId int32) *Quest {
	parentQuest := u.GetParentQuest(parentQuestId)
	if parentQuest == nil {
		logger.Error("get parentQuest is nil, parentQuestId: %v", parentQuestId)
		return nil
	}
	for _, quest := range parentQuest.GetQuestList() {
		if quest.QuestId == questId {
			return quest
		}
	}
	return nil
}

func (u *User) GetParentQuestNew(parentQuestId int32) *ParentQuest {
	parentQuestConfig := gdconf.GetConfigParentQuest(parentQuestId)
	if parentQuestConfig == nil {
		logger.Error("get parentQuestConfig is nil, parentQuestId: %v", parentQuestId)
		return nil
	}
	return u.GetParentQuest(parentQuestId)

	//switch parentQuestConfig.Type {
	//case config.QUEST_TYPE_MAIN:
	//	for _, parentQuest := range u.UserQuest.GetMainQuestList() {
	//		if parentQuest.ParentQuestId == parentQuestId {
	//			return parentQuest
	//		}
	//	}
	//case config.QUEST_TYPE_SIDE:
	//	for _, parentQuest := range u.UserQuest.GetSideQuestList() {
	//		if parentQuest.ParentQuestId == parentQuestId {
	//			return parentQuest
	//		}
	//	}
	//case config.QUEST_TYPE_DAILY:
	//	for _, parentQuest := range u.UserQuest.GetDailyQuestList() {
	//		if parentQuest.ParentQuestId == parentQuestId {
	//			return parentQuest
	//		}
	//	}
	//}
	return nil
}

func (u *User) GetNextQuest(parentQuest, curQuestId int32) *Quest {
	pQuest := u.GetSubQuest(parentQuest, curQuestId)
	if pQuest == nil {
		return nil
	}
	if pQuest.NextQuestId == 0 {
		return nil
	}
	pNextQuest := u.GetSubQuest(parentQuest, pQuest.NextQuestId)
	if pNextQuest == nil {
		return nil
	}
	return pNextQuest
}

func (p *ParentQuest) AddQuest(questId int32) {
	questConfig := gdconf.GetConfigQuest(questId)
	if questConfig == nil {
		logger.Error("get questConfig is nil, questId: %v", questId)
		return
	}
	var targetQuest *Quest = nil
	for i := 0; i < len(p.QuestList); i++ {
		if p.QuestList[i].QuestId == 0 {
			targetQuest = &(p.QuestList[i])
			break
		}
	}
	if targetQuest == nil {
		logger.Error("get targetQuest is nil, parentQuestId: %v", p.ParentQuestId)
		return
	}
	targetQuest.QuestId = questId
	targetQuest.State = config.QUEST_STATE_UNF
	for condIdx, cond := range questConfig.CondList {
		questCond := &(targetQuest.CondList[condIdx])
		questCond.Type = cond[0]
		for paramIdx := range cond[1:] {
			questCond.ParamList[paramIdx] = 0
			questCond.ParamListLen++
		}
	}
}

func (u *User) AddParentQuest(parentQuestId int32) {
	parentQuestConfig := gdconf.GetConfigParentQuest(parentQuestId)
	if parentQuestConfig == nil {
		logger.Error("get parentQuestConfig is nil, parentQuestId: %v", parentQuestId)
		return
	}
	var targetParentQuest *ParentQuest = nil
	switch parentQuestConfig.Type {
	case config.QUEST_TYPE_MAIN:
		for i := 0; i < len(u.UserQuest.MainQuestList); i++ {
			if u.UserQuest.MainQuestList[i].ParentQuestId == 0 {
				targetParentQuest = &(u.UserQuest.MainQuestList[i])
				break
			}
		}
	case config.QUEST_TYPE_SIDE:
		for i := 0; i < len(u.UserQuest.SideQuestList); i++ {
			if u.UserQuest.SideQuestList[i].ParentQuestId == 0 {
				targetParentQuest = &(u.UserQuest.SideQuestList[i])
				break
			}
		}
	case config.QUEST_TYPE_DAILY:
		for i := 0; i < len(u.UserQuest.DailyQuestList); i++ {
			if u.UserQuest.DailyQuestList[i].ParentQuestId == 0 {
				targetParentQuest = &(u.UserQuest.DailyQuestList[i])
				break
			}
		}
	}
	if targetParentQuest == nil {
		logger.Error("get targetParentQuest is nil, uid: %v", u.GetUid())
		return
	}
	targetParentQuest.ParentQuestId = parentQuestId
	targetParentQuest.State = config.QUEST_STATE_UNF
	for _, questId := range parentQuestConfig.QuestList {
		if questId == 0 {
			break
		}
		targetParentQuest.AddQuest(questId)
	}
	targetParentQuest.CurrQuestId = parentQuestConfig.QuestList[0]
	targetParentQuest.Type = parentQuestConfig.Type
	u.addParentQuest(targetParentQuest)
}

func (u *User) GetTrailGroupInfoBySceneId(sceneId int32) int32 {
	var allQuestList = u.GetParentQuestAll()
	for _, quest := range allQuestList {
		var trailQuestId = gdconf.GetTrailRoleGroupIdBySceneId(sceneId, quest.ParentQuestId)
		if trailQuestId != 0 {
			return trailQuestId
		}
	}
	return 0
}

func (u *User) PacketUserQuestAll(rsp *pb.SC_Fetch) {
	pbMainQuest := make([]*pb.ParentQuest, 0)
	pbSideQuest := make([]*pb.ParentQuest, 0)
	pbDailyQuest := make([]*pb.ParentQuest, 0)
	for _, quest := range u.GetParentQuestAll() {
		if quest.State == config.QUEST_STATE_FIN {
			continue
		}
		switch quest.Type {
		case config.QUEST_TYPE_MAIN:
			pbMainQuest = append(pbMainQuest, u.PacketParentQuest(quest))
		case config.QUEST_TYPE_SIDE:
			pbSideQuest = append(pbSideQuest, u.PacketParentQuest(quest))
		case config.QUEST_TYPE_DAILY:
			pbDailyQuest = append(pbDailyQuest, u.PacketParentQuest(quest))
		}
	}
	rsp.Quest = &pb.UserQuest{
		MainQuest:  pbMainQuest,
		SideQuest:  pbSideQuest,
		DailyQuest: pbDailyQuest,
	}
}
